home *** CD-ROM | disk | FTP | other *** search
- #include "CodeLib.h"
- #include "HyperXCmd.h"
- #include "SetUpA4.h"
-
- CODELIB;
-
- pascal void main(XCmdBlockPtr paramPtr)
- {
- int TempInt1, TempInt2;
- unsigned int Seed;
- long TempLong;
- StringHandle TempHdl;
- double TempDouble1, TempDouble2;
- Ptr TempPtr;
- Str255 TempStr;
-
- RememberA0();
- SetUpA4();
- LOADCODELIB();
- TempHdl = (StringHandle)NewHandle(256);
- TempPtr = *(paramPtr->params[0]);
- TempInt1 = atoi((char*)TempPtr);
- TempPtr = *(paramPtr->params[1]);
- TempLong = atol((char*)TempPtr);
- TempInt2 = (int)TempLong;
- TempInt1 = TempInt1 * TempInt2;
- TempDouble2 = (double)TempInt1;
- TempDouble1 = sqrt(TempDouble2);
- Seed = (unsigned int)TempDouble1;
- srand(Seed);
- (**idispatch)(CLsprintf,TempStr, "The square root of %d is %.2g.",
- TempInt1, TempDouble1);
- strcpy(*TempHdl, TempStr);
- paramPtr->returnValue = (Handle)TempHdl;
-
- UNLOADCODELIB();
- RestoreA4();
- }